package org.learn.spring5.service.impl;

import org.aspectj.lang.ProceedingJoinPoint;

//增强类，编写增强的方法

public class UserServiceProxy {
    public void before(){
    System.out.println("before");
}
    public void after(){
    System.out.println("After");
}
    public void afterReturning(){
        System.out.println("afterReturning");
    }
    public void afterThrowing(){
        System.out.println("AfterThrowing");
    }
    public void around(ProceedingJoinPoint proceedingJoinPoint){
        System.out.println("环绕之前");
        try {
            proceedingJoinPoint.proceed();
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        System.out.println("环绕之后");
    }

}
